<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>按钮抖动效果</title>
    <style>
        body{
            margin: 0;
            padding: 0;
            font-family: sans-serif;
            background-color: #f1f1f1;
        }
        .centre{
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }
        .btn{
            display: block;
            font-size: 20px;
            padding: 10px 20px;
            color: white;
            background-color: #34495e;
            cursor: pointer;
        }
        .btn:hover{
            animation: shake 0.6s infinite;
        }
        @keyframes shake {
            0%{
                transform: translate(0px, 0px) rotate(0deg);
            }
            25%{
                transform: translate(1px, 1px) rotate(1deg);
            }
            50%{
                transform: translate(-1px, -1px) rotate(-1deg);
            }
            75%{
                transform: translate(2px, -1px) rotate(2deg);
            }
            100%{
                transform: translate(-1px, 1px) rotate(-1deg);
            }
        }
    </style>
</head>
<body>
    <div class="centre">
        <a class="btn">Hover me</a>
    </div>
</body>
</html>